package com.cp.springcloud.authserver.auth;

import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;

/**
 * @author ChengPeng
 * @create 2020-04-27 10:25
 */
public class JedisTest {
    public static void main(String[] args) {
        //创建客户端
        Jedis jedis = new Jedis("自己的IP地址",6379);
        //设置密码
        jedis.auth("自己设置的密码");
        //设置值
        jedis.set("name","cphsw");
        //获取值
        String value = jedis.get("name");
        System.out.println(value);
        //释放连接资源
        jedis.close();
    }
}
